From 50c5bf97ea24da275a3398e2be549f4a2d2af693 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Tue, 31 Jan 2012 03:59:32 +0100 Subject: [PATCH] shorthand: Only unset values that are set Otherwise g_value_unset() complains. And that breaks the testsuite. --- gtk/gtkcssshorthandproperty.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gtk/gtkcssshorthandproperty.c b/gtk/gtkcssshorthandproperty.c index c74ddaea07..0dcfff0cad 100644 --- a/gtk/gtkcssshorthandproperty.c +++ b/gtk/gtkcssshorthandproperty.c @@ -84,6 +84,13 @@ _gtk_css_shorthand_property_query (GtkStyleProperty *property, shorthand->query (shorthand, value, query_func, query_data); } +static void +gtk_css_shorthand_property_unset_value (gpointer value) +{ + if (G_IS_VALUE (value)) + g_value_unset (value); +} + static gboolean gtk_css_shorthand_property_parse_value (GtkStyleProperty *property, GValue *value, @@ -95,7 +102,7 @@ gtk_css_shorthand_property_parse_value (GtkStyleProperty *property, guint i; array = g_array_new (FALSE, TRUE, sizeof (GValue)); - g_array_set_clear_func (array, (GDestroyNotify) g_value_unset); + g_array_set_clear_func (array, gtk_css_shorthand_property_unset_value); g_array_set_size (array, shorthand->subproperties->len); if (_gtk_css_parser_try (parser, "initial", TRUE)) -- 2.30.2